/*
 * 
 *  This file is part of Sourceprojects.org Lycia Copyright 2010 noctarius
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 * 
 */
package org.sourceprojects.lycia;

import java.lang.annotation.Annotation;

/**
 * This interface defines a {@link ConstraintValidator}raintValidator to be used
 * in validating annotated bean classes or method parameters in POJO parsers.
 * 
 * @author noctarius
 * @since 1.9.1
 * 
 * @param <T>
 *            Type of ContextObject to use
 */
public interface ConstraintValidator<T extends Annotation> {

	/**
	 * Initializes the {@link ConstraintValidator} instance with the actual
	 * annotation to validate against.
	 * 
	 * @param annotation
	 *            Annotation to validate against
	 */
	void initialize(T annotation);

	/**
	 * Validates the given object against the annotation given to the
	 * {@link ConstraintValidator} during initialization.
	 * 
	 * @param object
	 *            Object instance to validate
	 * @return true if validation was successful, false if not
	 */
	boolean isValid(Object object);
}
